const {con, ResData} = require('./common.js')

async function getAreas() {
  const res = new ResData()
  const sql = 'select * from areas'
  const [rows] = await con.execute(sql)
  console.log(rows)
  res.data = rows
  return res
}

async function addArea() {
  const res = new ResData()
  const sql = 'insert into areas(area_name) values("欧美")'
  const [rows] = await con.execute(sql)
  console.log(rows)
  return res
}

async function updateArea() {
  const res = new ResData()
  return res
}

async function delArea() {
  const res = new ResData()
  return res
}

module.exports = {
  getAreas,
  addArea,
  updateArea,
  delArea
}
